package com.ciis.system.user.mapper;

import com.ciis.base.Constants;
import com.ciis.base.page.IPage;
import com.ciis.system.user.domain.TSysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * User: zhangdajun
 * Date: 14-5-24
 * Time: 下午2:54
 * To change this template use File | Settings | File Templates.
 */
@Repository("sysUserMapper")
public interface ITSysUserMapper {

    /**
     * 保存用户
     * @param user
     * @throws Exception
     */
    public void save(TSysUser user) throws Exception;

    /**
     * 修改用户
     * @param user
     * @throws Exception
     */
    public void update(TSysUser user) throws Exception;

    /**
     * 根据ID删除用户
     * @param id
     * @throws Exception
     */
    public void delete(String id) throws Exception;

    /**
     * 根据ID查询用户
     * @param id
     * @return
     * @throws Exception
     */
    public TSysUser getUserById(String id) throws Exception;

    /**
     * 根据ID查询用户
     * @param name
     * @return
     * @throws Exception
     */
    public TSysUser getUserByName(String name) throws Exception;

    /**
     * 根据组织ID获取用户
     * @param page
     * @param orgId
     * @return
     * @throws Exception
     */
    public IPage<TSysUser> getUserListByOrgId(@Param(Constants.PAGE_KEY)IPage<TSysUser> page,@Param("orgId")String orgId) throws Exception;

    /**
     * 校验人员信息
     * @param params: loginId,password
     * @return
     */
    public TSysUser validateUser(HashMap<String,String> params);
}
